#include "QQClientController.h"

QQClientController::QQClientController(QWidget* parent)
	:QObject(parent)
{
	mClientView = new QQClientView(parent);
	qq_network->subscribeNetwork(this, QString("client"), QString("doReadyRead"));
	mClientView->setIsCentralStackedWidgetTransparent(true);
	mClientView->setUserInfoCardPixmap(QPixmap(":/QQClient/QQ.png"));
	mClientView->setWindowButtonFlags(ElaAppBarType::CloseButtonHint | ElaAppBarType::MinimizeButtonHint | ElaAppBarType::MaximizeButtonHint);
	mChatController = new QQChatController(mClientView);
}

QQClientController::~QQClientController()
{
}

void QQClientController::doReadyRead(const QJsonObject& data)
{
}

void QQClientController::showView()
{
	mClientView->show();
}

void QQClientController::closeView()
{
	mClientView->close();
}

void QQClientController::doMousePress(const QPoint& pos, Qt::MouseButton button)
{
	mChatController->doMousePress(pos, button);
}

void QQClientController::doForceOutLine()
{
	mClientView->showForceOutLineWindow();
}